<%--
  Created by LeeDvan.
  User: dl
  Date: 2021/5/21
  Time: 11:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/public/header/permissionCommon.jspf" %>



<html>
<head>
    <title>用户管理</title>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>

    <div class="layui-body">
        <div class="layui-tab layui-tab-brief" lay-filter="mainTable">
            <ul class="layui-tab-title">
                <li data-type="search" class="layui-this">查找用户</li>
                <li data-type="add">用户添加</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-panel panel">
                        <form class="layui-form layui-form-pane" style="position: relative;" action="" lay-filter="filter-form">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">姓名</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="user_name" autocomplete="off" class="layui-input"/>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">工号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="user_number" autocomplete="off" class="layui-input"/>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">身份证</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="identity" autocomplete="off" class="layui-input"/>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-inline">
                                        <select name="status" autocomplete="off">
                                            <option value="0">全部</option>
                                            <option value="1">正常</option>
                                            <option value="2">锁定</option>
                                            <option value="3">未注册</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">角色</label>
                                    <div class="layui-input-inline">
                                        <select name="role_id" autocomplete="off" lay-verify="required" lay-filter="filter-role-selector">
                                            <option value="0">全部</option>
                                            <%--<option value="3">护工</option>--%>
                                            <%--<option value="4" >老人</option>--%>
                                            <option value="2">机构管理员</option>
                                            <option value="1">区管理员</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">机构名字</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="jigou" autocomplete="off" class="layui-input"/>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">机构代码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="department_settlement_code" autocomplete="off" class="layui-input"/>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <div class="layui-input-block" style="width: auto">
                                        <button id="filter-form-submit" class="layui-btn" lay-submit lay-filter="filter-form-submit">搜索</button>
                                        <button type="reset" class="layui-btn">重置</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <table id="user-table" lay-filter="user-table"></table>
                </div>
                <div class="layui-tab-item">
                    <div style="position: relative;left: 15%;width: 70%;">
                    <form id="form_add_user" lay-filter="form_add_user" class="layui-form layui-form-pane">
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_name" lay-verify="required" placeholder="请输入姓名" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">工号</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_number" lay-verify="required" placeholder="请输入工号" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">手机</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_mobile" lay-verify="required" placeholder="请输入手机号" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">角色</label>
                            <div class="layui-input-block">
                                <input type="radio" name="role_id" value="1" title="区管理员">
                                <input type="radio" name="role_id" value="2" title="机构管理员" checked>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">机构代码</label>
                            <div class="layui-input-block">
                                <input type="text" name="department_settlement_code" autocomplete="off" class="layui-input"  placeholder="输入机构代码"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" id="form_add_user_submit" lay-submit lay-filter="form_add_user_submit">提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>

                        </div>
                    </form>
                      <%-- <form class="layui-form" action="">
                           <div class="layui-form-item">
                               <label class="layui-form-label">输入框</label>
                               <div class="layui-input-block">
                                   <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                               </div>
                           </div>
                           <div class="layui-form-item">
                               <label class="layui-form-label">密码框</label>
                               <div class="layui-input-inline">
                                   <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                               </div>
                               <div class="layui-form-mid layui-word-aux">辅助文字</div>
                           </div>
                           <div class="layui-form-item">
                               <label class="layui-form-label">选择框</label>
                               <div class="layui-input-block">
                                   <select name="city" lay-verify="required">
                                       <option value=""></option>
                                       <option value="0">北京</option>
                                       <option value="1">上海</option>
                                       <option value="2">广州</option>
                                       <option value="3">深圳</option>
                                       <option value="4">杭州</option>
                                   </select>
                               </div>
                           </div>
                           <div class="layui-form-item">
                               <label class="layui-form-label">复选框</label>
                               <div class="layui-input-block">
                                   <input type="checkbox" name="like[write]" title="写作">
                                   <input type="checkbox" name="like[read]" title="阅读" checked>
                                   <input type="checkbox" name="like[dai]" title="发呆">
                               </div>
                           </div>
                           <div class="layui-form-item">
                               <label class="layui-form-label">开关</label>
                               <div class="layui-input-block">
                                   <input type="checkbox" name="switch" lay-skin="switch">
                               </div>
                           </div>
                           <div class="layui-form-item">
                               <label class="layui-form-label">单选框</label>
                               <div class="layui-input-block">
                                   <input type="radio" name="sex" value="男" title="男">
                                   <input type="radio" name="sex" value="女" title="女" checked>
                               </div>
                           </div>
                           <div class="layui-form-item layui-form-text">
                               <label class="layui-form-label">文本域</label>
                               <div class="layui-input-block">
                                   <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                               </div>
                           </div>
                           <div class="layui-form-item">
                               <div class="layui-input-block">
                                   <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                   <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                               </div>
                           </div>
                       </form>--%>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script type="text/html" id="userPageLayer">
        {{# var data = d.data }}
        <form class="layui-form layui-form-pane" lay-filter="form-{{d.id}}">

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-inline">
                        <input  type="text" class="layui-input"  placeholder="请输入真实姓名" name="name" autocomplete="off" lay-verify="required">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">身份证号</label>
                    <div class="layui-input-inline">
                        <input  type="text" name="identity" class="layui-input"  placeholder="请输入身份证号"
                                autocomplete="off" lay-verify="required|identity">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">工号</label>
                    <div class="layui-input-inline">
                        <input  type="text" class="layui-input"  placeholder="请输入卡号" name="number" autocomplete="off" lay-verify="required">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">出生日期</label>
                    <div class="layui-input-inline">
                        <input type="date" name="birthday" class="layui-input"
                               placeholder="请选择出生日期"  autocomplete="off" lay-verify="required">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-inline">
                        <input type="radio" name="gender" value="1" title="男"/>
                        <input type="radio" name="gender" value="0" title="女"/>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-inline">
                        <input type="tel" name="tel" class="layui-input" placeholder="请输入手机号"
                               autocomplete="off" lay-verify="required|phone">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-inline">
                        <input type="email" name="email" class="layui-input"  placeholder="请输入邮箱"
                               autocomplete="off">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">家庭住址</label>
                <div class="layui-input-inline">
                    <input type="text" name="address" class="layui-input"  placeholder="请输入家庭地址"
                           autocomplete="off">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">角色</label>
                    <div class="layui-input-inline">
                        <select name="role" autocomplete="off" lay-verify="required" lay-filter="role-selector-{{d.id}}">
                            <option value="">必填项：请选择所属角色</option>
                            <option value="3">护工</option>
                            <option value="4" >老人</option>
                            <option value="2">机构管理员</option>
                            <option value="1">区管理员</option>
                        </select>
                    </div>
                </div>
                <div id="institution_item_{{d.id}}" class="layui-inline layui-hide">
                    <label class="layui-form-label">机构</label>
                    <div class="layui-input-inline">
                        <select name="institution"  lay-filter="institution-selector-{{d.id}}" lay-search>
                            <option value=""></option>
                            <option value="机构A">机构A</option>
                            <option value="机构A">机构B</option>
                            <option value="机构A">机构C</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <button class="layui-btn" lay-submit lay-filter="submit-{{d.id}}">提交</button>
                    <button type="button" class="layui-btn">默认</button>
                    <button type="reset" class="layui-btn" >重置</button>
                </div>
            </div>
        </form>
    </script>


    <!--底部-->
    <div id="footer"></div>
    <%--<script src="${webPath}/js/permission/auth/permList.js"></script>--%>
    <script src="${webPath}/js/system-monitor/user/user-page.js"></script>

    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>

</div>

<script type="text/html" id="rowToolbarLayer">
    <a class="layui-btn layui-btn-xs" lay-event="view">查看</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

</body>

<style>
    .label-status{
        background-color: #e9e4e4;
        border-radius: 20%;
        padding: 2px;
    }
    .label-role {
        border-radius: 8%;
        padding: 2px;
        border-style: solid;
        border-width: thin;
        border-color: #6f6262a3;
    }
</style>

<script type="text/html" id="template-status">
    {{# if(d.status == 1){ }}
    <span class="label-status" style="color:#104b0e;"><i class="layui-icon layui-icon-ok-circle"></i>  正常</span>
    {{# }else if(d.status == 2){ }}
    <span class="label-status" style="color:saddlebrown;"><i class="layui-icon layui-icon-password"></i>  锁定</span>
    {{# }else if(d.status == 3){ }}
    <span class="label-status" style="color:black;"><i class="layui-icon layui-icon-user"></i>  未注册</span>
    {{# }else{ }}
    d.status
    {{# } }}
</script>

<script type="text/html" id="template-role">
    {{# if(d.role_id == 0){ }}
    <span class="label-role">测试员</span>
    {{# }else if(d.role_id == 1){ }}
    <span class="label-role">区管理员</span>
    {{# }else if(d.role_id == 2){ }}
    <span class="label-role">机构管理员</span>
    {{# }else{ }}
    {{d.role_id}}
    {{# } }}
</script>

<%--预览/编辑用户信息层--%>
<div style="display: none;padding: 12px;" id="editUserLayer">
    <form id="form_edit_user" lay-filter="form_edit_user" class="layui-form">
        <div class="layui-form-item">
            <input type="hidden" name="user_id">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="user_name" lay-verify="required" placeholder="请输入姓名" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">工号</label>
                <div class="layui-input-inline">
                    <input type="text" name="user_number" lay-verify="required" placeholder="请输入工号" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                    <input type="text" name="password"  placeholder="请输入密码" class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                <input type="radio" name="role_id" value="1" title="区管理员">
                <input type="radio" name="role_id" value="2" title="机构管理员" checked>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">身份证号码</label>
                <div class="layui-input-inline">
                    <input type="text" name="identity"  lay-verify="required|identity" autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-inline">
                    <input type="radio" name="user_sex" value="男" title="男"/>
                    <input type="radio" name="user_sex" value="女" title="女"/>
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="tel" name="user_mobile" lay-verify="required|phone"  autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                    <input type="email" name="user_email" lay-verify="email"  autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <input type="text" name="family" placeholder="请输入地址" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">机构代码</label>
            <div class="layui-input-inline">
                <input type="text"  name="department_settlement_code" autocomplete="off" class="layui-input"  placeholder="输入机构代码"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <select name="status" autocomplete="off">
                    <option value="0">全部</option>
                    <option value="1">正常</option>
                    <option value="2">锁定</option>
                    <option value="3">未注册</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <button type="button" lay-submit lay-filter="form_edit_user_submit" id="form_edit_user_submit" class="layui-btn layui-btn-lg layui-hide">提交</button>
            <button type="button" id="form_edit_user_edit" class="layui-btn layui-btn-primary">修改</button>
        </div>
    </form>
</div>

</html>

